<?php
require_once '../sub/init.php';
require_once ZEAI.'sub/conn.php';
require_once ZEAI.'cache/config_index.php';
require_once ZEAI.'cache/config_tjdiy.php';
require_once ZEAI.'cache/udata.php';
$switch = json_decode($_ZEAI['switch'],true);
$jumpurl = HOST.'/m/hongniang_ulist.php?uid='.$uid;
$nodatatips="<div class='nodatatips'><i class='ico'>&#xe608;</i>暂时木有符合条件的会员</div>";
$t=trimhtml(dataIO($t,'out'));
function rows_ulist($rows,$p,$n=1) {
	global $_ZEAI,$_INDEX,$cook_uid,$cook_sex,$cook_grade,$zeai_cn,$t;
	$switch = json_decode($_ZEAI['switch'],true);
	$blurclass = '';$lockstr = '';$ifblur=0;
	if(ifmLockBlur()){
		$lockstr = '<i class="ico lockico">&#xe659;</i><div class="lockstr">'.dataIO($switch['grade1LockBlurT'],'out').'</div>';
		$ifblur=1;
		$photo_b = 'blur';
	}else{
		$photo_b = ($_INDEX['waterfall_photo']=='b')?'b':'m';
	}
	$uid           = $rows['id'];
	$sex           = $rows['sex'];
	$grade         = $rows['grade'];
	$photo_s       = $rows['photo_s'];
	$photo_f       = $rows['photo_f'];
	$heigh         = $rows['heigh'];
	$job           = $rows['job'];
	$age = getage($rows['birthday']);
	$RZ  = $rows['RZ'];$RZarr = explode(',',$RZ);
	$pay = $rows['pay'];
	$edu = $rows['edu'];
	$photo_ifshow = $rows['photo_ifshow'];
	$age_str   = ($age>18)?$age.'岁':'';
	$edu_str   = (ifint($edu))?udata('edu',$edu):'';
	$heigh_str = (ifint($heigh))?' · '.udata('heigh',$heigh).' · ':'';
	$pay_str   = (ifint($pay))?'<b>'.udata('pay',$pay).'</b>':'';
	$job_str   = (ifint($job))?'<b>'.udata('job',$job).'</b>':'';
	if($photo_ifshow==0 && $ifblur==0){
		$lockstr = '';
		$photo_b_url=RES.'photo_m'.$sex.'_hide.png';
	}else{
		$photo_b_url = (!empty($photo_s) && $photo_f==1)?UP.smb($photo_s,$photo_b):RES.'photo_m'.$sex.'.png';	
	}
	$echo .= '<a href="hongniang_u.php?uid='.$uid.'"><img class="m" src="'.$photo_b_url.'" />';
	$echo .= '<div class="uinfo">';
	//$echo .= '<div class="nik"><span>'.uicon($sex.$grade).$uid.'</span></div>';
	$echo.= '<div class="data"><span>'.uicon($sex.$grade).'<font>'.$age_str.$heigh_str.$edu_str.'</font></span><span>'.$job_str.$pay_str.'</span></div>';
	$echo .= '</div>';
	if(@count($RZarr)>1)$echo.= '<img src="'.RES.'m/img/rzj.png" class="rzj">';
	//if (!empty($RZ))$echo.= '<div class="payrz">'.RZ_html($RZ,'s','color').'</div>';
	$echo.= $lockstr.'</a>';
	if($n % 2 == 0)$echo.= '<div class="clear"></div>';
	return $echo;
}
$fields    = "id,sex,grade,photo_s,photo_f,RZ,birthday,edu,pay,job,heigh,photo_ifshow";
$ZEAI_SQL  = " flag=1 AND (kind=2 OR kind=3) ";// AND dataaflag=1
$ORDER     = " ORDER BY refresh_time DESC,id DESC ";
$ZEAI_SQL2 = " a.flag=1 AND (a.kind=2 OR a.kind=3) ";// AND a.dataaflag=1
$fields2   = "a.id,a.sex,a.grade,a.nickname,a.photo_s,a.photo_f,a.RZ,a.birthday,a.edu,a.pay,a.job,a.heigh,a.photo_ifshow";
switch ($t) {
	case 'vip':$mt = 'VIP会员';
		$ZEAI_SQL   .= "AND grade>1 ";
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY grade DESC,refresh_time DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'new':$mt ='最新注册会员';
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'endtime':$mt='最近登录会员';
		$ZEAI_SELECT="SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY endtime DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'endgift':$mt='最近送礼会员';
		$ZEAI_SELECT = "SELECT ".$fields2." FROM ".__TBL_USER__." a,(SELECT * FROM ".__TBL_GIFT_USER__." ORDER BY id DESC) b WHERE ".$ZEAI_SQL2." AND a.id=b.senduid GROUP BY b.senduid ORDER BY b.id DESC";
		$TP=getTP($ZEAI_SELECT,true);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'endpay':$mt='最近充值会员';
		$ZEAI_SELECT = "SELECT ".$fields2." FROM ".__TBL_USER__." a,(SELECT * FROM ".__TBL_PAY__." ORDER BY id DESC) b WHERE ".$ZEAI_SQL2." AND a.id=b.uid AND b.kind>0 AND b.flag=1 GROUP BY b.uid ORDER BY b.id DESC";
		$TP=getTP($ZEAI_SELECT,true);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'click':$mt='人气会员';
		$ZEAI_SQL  .= " AND click>0 ";
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY click DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'cert':$mt='认证会员';
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." AND length(RZ)>3 ".$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'offline':$mt='线下优质会员';
		$ZEAI_SQL .= " AND (kind=2 OR kind=3) ";
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		/*		$Garr = getSmodeUGarr();
				if (!empty($Garr) && str_len($Garr)>1){
					$ZEAI_SQL .= " AND grade IN($Garr) ";
					$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
					$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
				}else{$ZEAI_total=0;$ZEAI_totalP=0;}
		*/
	break;
	case 'photo':$mt='最近上传相册会员';
		$ZEAI_SELECT = "SELECT ".$fields2." FROM ".__TBL_USER__." a,(SELECT * FROM ".__TBL_PHOTO__." ORDER BY id DESC) b WHERE ".$ZEAI_SQL2." AND a.id=b.uid AND b.flag=1 GROUP BY b.uid ORDER BY b.id DESC";
		$TP=getTP($ZEAI_SELECT,true);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'loveb':$mt='土豪会员';
		$ZEAI_SQL  .= " AND loveb>0 ";
		$ZEAI_SELECT= "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY loveb DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'fans':$mt='最有魅力会员';
		$ZEAI_SELECT= "SELECT ".$fields.",(SELECT COUNT(*) FROM ".__TBL_GZ__." WHERE uid=a.id AND flag=1 ) AS fansnum FROM ".__TBL_USER__." a WHERE ".$ZEAI_SQL." ORDER BY fansnum DESC,refresh_time DESC,id DESC";
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	case 'keyword':
		if (!empty($keyword)){
			$keyword = trimhtml(dataIO($keyword,'out'));
			if (ifint($keyword)){
				$ZEAI_SQL .= " AND id='$keyword' ";
			}else{
				$ZEAI_SQL .= " AND nickname LIKE '%".$keyword."%' ";
			}
			$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
			$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		}
	break;
	case 'diy':
		if(ifint($did)){
			$mt =tjdiy_info($did,'title');
			$par=tjdiy_info($did,'par');
			parse_str($par,$pararr);
			function arrV($pararr,$F) {
				if (count($pararr) >= 1 && is_array($pararr)){
					foreach ($pararr as $k=>$v) {
						if($F==$k)return $v;
					}
				}
				return '';
			}
			$areaid2=arrV($pararr,'areaid2');if (!empty($areaid2))$ZEAI_SQL  .= " AND area2id LIKE '%".$areaid2."%' ";
			$sex=arrV($pararr,'sex');if (ifint($sex))$ZEAI_SQL       .= " AND sex=$sex ";
			$areaid=arrV($pararr,'areaid');if (!empty($areaid))$ZEAI_SQL   .= " AND areaid LIKE '%".$areaid."%' ";
			$age1=arrV($pararr,'age1');if (ifint($age1))$ZEAI_SQL      .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) >= $age1 ) ";
			$age2=arrV($pararr,'age2');if (ifint($age2))$ZEAI_SQL      .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) <= $age2 ) ";
			$pay=arrV($pararr,'pay');if (ifint($pay))$ZEAI_SQL       .= " AND pay>=$pay ";
			$edu=arrV($pararr,'edu');if (ifint($edu))$ZEAI_SQL       .= " AND edu>=$edu ";
			$job=arrV($pararr,'job');if (ifint($job))$ZEAI_SQL       .= " AND job=$job ";
			$love=arrV($pararr,'love');if (ifint($love))$ZEAI_SQL      .= " AND love=$love ";
			$child=arrV($pararr,'child');if (ifint($child))$ZEAI_SQL     .= " AND child=$child ";
			$marrytype=arrV($pararr,'marrytype');if (ifint($marrytype))$ZEAI_SQL .= " AND marrytype=$marrytype ";
			$marrytime=arrV($pararr,'marrytime');if (ifint($marrytime))$ZEAI_SQL .= " AND marrytime=$marrytime ";
			$heigh1=arrV($pararr,'heigh1');if (ifint($heigh1))$ZEAI_SQL    .= " AND ( heigh >= $heigh1 ) ";
			$heigh2=arrV($pararr,'heigh2');if (ifint($heigh2))$ZEAI_SQL    .= " AND ( heigh <= $heigh2 ) ";
			$weigh1=arrV($pararr,'weigh1');if (ifint($weigh1))$ZEAI_SQL    .= " AND ( heigh >= $weigh1 ) ";
			$weigh2=arrV($pararr,'weigh2');if (ifint($weigh2))$ZEAI_SQL    .= " AND ( weigh <= $weigh2 ) ";
			$car=arrV($pararr,'car');if (ifint($car))$ZEAI_SQL       .= " AND car>=$car ";
			$house=arrV($pararr,'house');if (ifint($house))$ZEAI_SQL     .= " AND house=$house ";
			$smoking=arrV($pararr,'smoking');if (ifint($smoking))$ZEAI_SQL     .= " AND smoking=$smoking ";
			$drink=arrV($pararr,'drink');if (ifint($drink))$ZEAI_SQL       .= " AND drink=$drink ";
			$companykind=arrV($pararr,'companykind');if (ifint($companykind))$ZEAI_SQL .= " AND companykind=$companykind ";
			$ifmob=arrV($pararr,'ifmob');if (ifint($ifmob))$ZEAI_SQL       .= " AND mob<>'' ";
			$ifdata=arrV($pararr,'ifdata');if (ifint($ifdata))$ZEAI_SQL      .= " AND myinfobfb>10 ";
			$ifadmid=arrV($pararr,'ifadmid');if ($ifadmid==1)$ZEAI_SQL .= " AND admid>0 ";
			$iftguid=arrV($pararr,'iftguid');if ($iftguid==1)$ZEAI_SQL .= " AND tguid>0 ";
			$ifdata50=arrV($pararr,'ifdata50');if($ifdata50 == 1)$ZEAI_SQL .= " AND myinfobfb>50 ";
			$ifparent=arrV($pararr,'ifparent');if($ifparent == 1)$ZEAI_SQL .= " AND parent>1 ";
			$photo_s=arrV($pararr,'photo_s');if ($photo_s == 1)$ZEAI_SQL .= " AND photo_s<>'' ";
			$grade2=arrV($pararr,'grade2');if ($grade2 == 1)$ZEAI_SQL  .= " AND grade>1 ";
			$grade=arrV($pararr,'grade');if (ifint($grade))$ZEAI_SQL .= " AND grade=".$grade;
		}
		$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
		$par = '&did='.$did;
	break;
	case 'ext':
		$sex=trimhtml(dataIO($sex,'out'));if(!empty($sex))$ZEAI_SQL .= doinsql('sex',$sex);
		$photo_s=intval($photo_s);if ($photo_s == 1)$ZEAI_SQL .= " AND photo_s<>'' AND photo_f=1 ";
		$areaid=trimhtml(dataIO($areaid,'out'));
		$area2id=trimhtml(dataIO($area2id,'out'));
		$areaid=getareaSQL($areaid);
		$area2id=getareaSQL($area2id);
		if(!empty($areaid))$ZEAI_SQL .= " AND areaid LIKE '%".$areaid."%' ";
		if(!empty($area2id))$ZEAI_SQL .= " AND area2id LIKE '%".$area2id."%' ";
		//age
		$age=trimhtml(dataIO($age,'out'));
		if(!empty($age)){
			$agearr=explode(',',$age);
			if (count($agearr) >= 1 && is_array($agearr)){
				$SQL="";
				foreach ($agearr as $V) {
					$V=explode('-',$V);$V1=intval($V[0]);$V2=intval($V[1]);$SQL1="";$SQL2="";
					if(ifint($V1))$SQL1 = "  ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) >= '$V1' ) ";
					if(ifint($V2))$SQL2 = "  ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) <= '$V2' ) ";
					if(!empty($SQL1) && !empty($SQL2)){
						if(!empty($SQL))$SQL .= " OR ";
						$SQL .= "(".$SQL1." AND ".$SQL2.")";
					}
				}
				$ZEAI_SQL .= " AND (".$SQL.") ";
			}
		}
		//heigh
		$heigh=trimhtml(dataIO($heigh,'out'));
		if(!empty($heigh)){
			$heigharr=explode(',',$heigh);
			if (count($heigharr) >= 1 && is_array($heigharr)){
				$SQL="";
				foreach ($heigharr as $V) {
					$V=explode('-',$V);$V1=intval($V[0]);$V2=intval($V[1]);$SQL1="";$SQL2="";
					if (ifint($V1))$SQL1 = " ( heigh >= '$V1' ) ";
					if (ifint($V2))$SQL2 = " ( heigh <= '$V2' ) ";
					if(!empty($SQL1) && !empty($SQL2)){
						if(!empty($SQL))$SQL .= " OR ";
						$SQL .= "(".$SQL1." AND ".$SQL2.")";
					}
				}
				$ZEAI_SQL .= " AND (".$SQL.") ";
			}
		}
		//edu
		$edu=trimhtml(dataIO($edu,'out'));if(!empty($edu))$ZEAI_SQL .= doinsql('edu',$edu);
		//pay
		$pay=trimhtml(dataIO($pay,'out'));if(!empty($pay))$ZEAI_SQL .= doinsql('pay',$pay);
		//job
		$job=trimhtml(dataIO($job,'out'));if(!empty($job))$ZEAI_SQL .= doinsql('job',$job);
		//love
		$love=trimhtml(dataIO($love,'out'));if(!empty($love))$ZEAI_SQL .= doinsql('love',$love);
		//house
		$house=trimhtml(dataIO($house,'out'));if(!empty($house))$ZEAI_SQL .= doinsql('house',$house);
		//car
		$car=trimhtml(dataIO($car,'out'));if(!empty($car))$ZEAI_SQL .= doinsql('car',$car);
		//marrytime
		$marrytime=trimhtml(dataIO($marrytime,'out'));if(ifint($marrytime))$ZEAI_SQL .= " AND marrytime='$marrytime' ";
		$par = "&sex=".$sex."&photo_s=".$photo_s."&areaid=".$areaid."&area2id=".$area2id."&age=".$age."&heigh=".$heigh."&edu=".$edu."&pay=".$pay."&job=".$job."&love=".$love."&house=".$house."&car=".$car."&marrytime=".$marrytime;
		$ZEAI_SELECT = "SELECT ".$fields." FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
	default:
		$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
		$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];
	break;
}
$cs = "t=".$t."&keyword=".$keyword.$par;
if($submitok=='ZEAI_list'){exit(Zeai_ajax_list_fn($ZEAI_totalP,$p));}
?>
<!doctype html><html><head><meta charset="utf-8">
<title>线下会员展示-<?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/hongniang.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/hongniang_ulist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<style>
#backtop a{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.mask{top:94px}
.sotab li.ed i,
.sotab li.ed span,
.soubox a.ed,
.soubox a.ed:after{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.souext ul.def li.ed,.areabox .ul li a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.ZEAI_list a .uinfo .data span b{background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.05);color:<?php echo $_ZEAI['mob_mbcolor'];?>;border:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1) 1px solid}
.areabox .ul li a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.areabox .ul dt.ed,.listbox dl dd span.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
</style>
</head><body>
<?php
$mini_title=(!empty($mt))?$mt:'会员展示';
$mini_class='top_mini4 zeaibg bgcolor';
$mini_L = '<em onClick="zeai.openurl(\''.HOST.'/m/hongniang.php\')"><i class="ico" >&#xeaca;</i></em>';
//$mini_R = '<a href="'.HOST.'"><i class="ico" >&#xe636;</i></a>';
require_once ZEAI.'m/top_mini.php';?>
<ul class="sotab flex" id="sotab">
    <li><span>排序</span><i class="ico">&#xe60b;</i></li>
    <li><span>推荐</span><i class="ico">&#xe60b;</i></li>
    <li id="test"><span>筛选</span><i class="ico">&#xe60b;</i></li>
</ul>
<!--默认排序-->
<div class="soubox" id="sotab1">
	<a href="<?php echo SELF;?>?t=vip"<?php echo ($t == 'vip')?' class="ed"':'';?>>VIP高级会员</a>
	<a href="<?php echo SELF;?>?t=new"<?php echo ($t == 'new')?' class="ed"':'';?>>最新注册</a>
	<a href="<?php echo SELF;?>?t=endtime"<?php echo ($t == 'endtime')?' class="ed"':'';?>>最近登录</a>
	<a href="<?php echo SELF;?>?t=cert"<?php echo ($t == 'cert')?' class="ed"':'';?>>认证会员</a>
	<a href="<?php echo SELF;?>?t=click"<?php echo ($t == 'click')?' class="ed"':'';?>>人气最高</a>
	<a href="<?php echo SELF;?>?t=offline"<?php echo ($t == 'offline')?' class="ed"':'';?>>线下优质会员</a>
	<a href="<?php echo SELF;?>?t=fans"<?php echo ($t == 'fans')?' class="ed"':'';?>>最有魅力会员</a>
	<a href="<?php echo SELF;?>?t=loveb"<?php echo ($t == 'loveb')?' class="ed"':'';?>>土豪会员</a>
	<a href="<?php echo SELF;?>?t=photo"<?php echo ($t == 'photo')?' class="ed"':'';?>>最近上传相册会员</a>
	<a href="<?php echo SELF;?>?t=endpay"<?php echo ($t == 'endpay')?' class="ed"':'';?>>最近充值会员</a>
	<a href="<?php echo SELF;?>?t=endgift"<?php echo ($t == 'endgift')?' class="ed"':'';?>>最近送礼会员</a>
</div>
<!--红娘推荐-->
<div class="soubox" id="sotab2">
	<?php
    for($i=1;$i<=$_TJDIY['tjdiy_num'];$i++){
        $title=tjdiy_info($i,'title');
        $par=tjdiy_info($i,'par');
        if(empty($title)||empty($par))continue;?>
        <a href="<?php echo SELF;?>?t=diy&zeai_cn=diy&did=<?php echo $i;?>"<?php echo ($did == $i)?' class="ed"':'';?>><?php echo $title;?></a>
    <?php }?>
</div>
<!--高级筛选-->
<div class="soubox souext" id="sotab3">
	<form action="<?php echo SELF;?>" class="form_uid">
        <input name="keyword" type="text" class="input" id="keyword" maxlength="20" value="<?php echo $keyword;?>" placeholder="输入会员UID号/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
        <input type="hidden" name="t" value="keyword">
	</form>
    <form action="<?php echo SELF;?>" method="get">
	<?php
	soulout('sex',$sex,3);//性别
	soulout('photo_s',$photo_s,2,json_decode('[{"i":"1","v":"有头像"}]'),' col3');//头像
	?>
    <!--地区-->
    <!--gz-->
    <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
    <input type="hidden" id="form_areaid" name="areaid" value="<?php echo $areaid;?>">
    <input type="hidden" id="form_areatitle" name="areatitle" value="<?php echo $areatitle;?>">
    <div class="listbox">
		<dl id="areaid" data="<?php echo $areaid;?>"><dt>工作地</dt><dd><span id="areatitle"><?php echo $areatitle;?></span></dd></dl>
    </div>
    <!--hj-->
    <div id="areabox2" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
    <input type="hidden" id="form_area2id" name="area2id" value="<?php echo $area2id;?>">
    <input type="hidden" id="form_area2title" name="area2title" value="<?php echo $area2title;?>">
    <div class="listbox">
		<dl id="area2id" data="<?php echo $area2id;?>"><dt>户籍地</dt><dd><span id="area2title"><?php echo $area2title;?></span></dd></dl>
    </div>
    <!--地区结束-->
    <?php
	soulout('age',$age,3,json_decode('[{"i":"18-22","v":"18-22岁"},{"i":"23-25","v":"23-25岁"},{"i":"26-30","v":"26-30岁"},{"i":"31-35","v":"31-35岁"},{"i":"36-40","v":"36-40岁"},{"i":"41-45","v":"41-45岁"},{"i":"51-60","v":"51-60岁"},{"i":"61-120","v":"60岁以上"}]'),' col3');//年龄
	//身高
	$dw=json_decode($_UDATA['heigh'],true);$dw=$dw['dw'];
	soulout('heigh',$heigh,3,json_decode('[{"i":"0-149","v":"149'.$dw.'以下"},{"i":"150-155","v":"150-155'.$dw.'"},{"i":"156-160","v":"156-160'.$dw.'"},{"i":"161-165","v":"161-165'.$dw.'"},{"i":"166-170","v":"166-170'.$dw.'"},{"i":"171-180","v":"171-180'.$dw.'"},{"i":"180-280","v":"180'.$dw.'以上"}]'));
	soulout('edu',$edu,3);//学历
	soulout('pay',$pay,3);//收入
	soulout('job',$job,3);//职业
	soulout('love',$love,3);//婚况
	soulout('house',$house,3,'',' col3');//房
	soulout('car',$car,3,'',' col3');//车
	soulout('marrytime',$marrytime,2,'',' col3');//结婚时间?>
    <div class="savebox"><button type="button" class="btn size3 reset" id="souextresetbtn">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    <input type="hidden" name="t" value="ext">
    </form>
</div>
<div class="ZEAI_list" id="ZEAI_list"><?php if($ZEAI_totalP>0){echo Zeai_ajax_list_fn($ZEAI_totalP,$p);}else{echo $nodatatips;}?></div>
<?php if ($ZEAI_total > $_ZEAI['pagesize']){?>
<script>
var ZEAI_totalP = parseInt(<?php echo $ZEAI_totalP; ?>),p=2;
var scs='<?php echo trimhtml($cs); ?>';
var postjson = {submitok:'ZEAI_list',ZEAI_totalP:ZEAI_totalP};
if(!zeai.empty(scs))Object.assign(postjson,tojson(scs.split('&')));
zeaiOnscroll_json={url:'hongniang_ulist'+zeai.extname,data:postjson};
document.body.onscroll = zeaiOnscroll;
</script>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php }?>
<?php require_once ZEAI.'m/TRnav.php';?>
<div class="blank"></div></body></html>
<?php
function soulout($t,$t_v,$subkind,$newarr='',$ulcls='') {
	global $_UDATA;
	$ARR = (is_array($newarr) && count($newarr)>0)?$newarr:json_decode($_UDATA[$t]);
	if(is_array($ARR) && count($ARR)>0){
		$tstr=data_data_title($t);
		//$tstr=($t=='edu' || $t=='pay')?$tstr.'<font>（最低）</font>':$tstr;
		echo '<div class="tbox" id="t'.$t.'">';
		echo '<h5>'.$tstr.'</h5>';
		echo '<ul class="def'.$ulcls.'">';
		$cls=(empty($t_v))?' class="ed"':'';
		echo '<li'.$cls.' v="0">不限</li>';
		$defv=explode(',',$t_v);
		foreach ($ARR as $V){
			$cls='';
			if(count($defv)>1 && is_array($defv)){
				foreach ($defv as $V2) {if($V->i==$V2){$cls=' class="ed"';break;}}
			}else{
				$cls=($V->i==$t_v)?' class="ed"':'';
			}
			echo '<li'.$cls.' v="'.$V->i.'">'.$V->v.'</li>';
		}
		echo '</ul></div>';
		echo '<input type="hidden" id="'.$t.'" name="'.$t.'" value="'.$t_v.'">';
		if($subkind==3){
			echo '<script>reg_diy_checkbox("'.$t.'");</script>';
		}else{
			echo '<script>reg_diy_radio("'.$t.'");</script>';
		}
	}
}
function data_data_title($F,$data_arr='') {$data_data=(empty($data_arr))?data_data_arr():$data_arr;foreach($data_data as $v){if($v['fieldname'] == $F)return $v['title'];}}
function data_data_subkind($F,$data_arr='') {$data_data=(empty($data_arr))?data_data_arr():$data_arr;foreach($data_data as $v){if($v['fieldname'] == $F)return $v['subkind'];}}
function data_data_arr() {
	global $db;
	$rt = $db->query("SELECT fieldname,title,subkind FROM ".__TBL_UDATA__." WHERE flag=1 ORDER BY px DESC,id DESC");
	while($tmprows = $db->fetch_array($rt,'name')){$data_data[]=$tmprows;}
	return $data_data;
}
function getTP($TJ,$moretb=false) {
	global $_ZEAI,$db;
	if($moretb){
		$rt = $db->query("SELECT COUNT(*) FROM (".$TJ.") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}else{
		$rt = $db->query("SELECT COUNT(*) FROM (SELECT id FROM ".__TBL_USER__." WHERE ".$TJ." LIMIT ".$_ZEAI['limit'].") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}
	$total=$row[0];
	return array($total,ceil($total/$_ZEAI['pagesize']));
}
function tjdiy_info($id,$k) {
	global $_TJDIY;
	$ARR = json_decode($_TJDIY['tjdiy'],true);
	if (count($ARR) >= 1 && is_array($ARR)){
		foreach ($ARR as $V) {
			if($V['id']==$id){
				switch ($k) {
					case 'title':return $V['title'];break;
					case 'par':return $V['par'];break;
				}			
			}
		}
	}
	return false;
}	
function doinsql($F,$V) {
	if(!empty($V)){
		$Varr=explode(',',$V);
		if (count($Varr) >= 1 && is_array($Varr)){
			$newARR=array();
			foreach ($Varr as $v2) {if(ifint($v2))$newARR[]=$v2;}
			if(count($newARR)>0){
				$list = (is_array($newARR))?implode(',',$newARR):'';	
				$ZEAI_SQL = " AND $F IN ($list) ";
			}
		}
	}
	return $ZEAI_SQL;
}
?>